-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HH-212492 use fastapi server/routing #695
Conversation
frontik/app.py
Outdated
return chunk | ||
|
||
|
||
async def core_middle_ware(request: Request, call_next): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
middelware в одно слово
7696346
to
cb651ff
Compare
frontik/routing.py
Outdated
return super().get(path, **kwargs) | ||
|
||
def post(self, path: str, **kwargs) -> Callable: | ||
self._cls, self._path = kwargs.pop('cls'), path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему тогда cls не сделать параметром?
page_module_name = '.'.join(filter(None, (self.name, page_name))) | ||
routing_logger.debug('page module: %s', page_module_name) | ||
def build_path() -> str: | ||
curframe = inspect.currentframe() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не могу найти, где build_path вызывается?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это в сервисах будет
@router.get(build_path(), cls=PageHandler, dependencies=[d1,d2])
async def my_mega_page(self=get_current_handler):
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
там нельзя как-то __file__
передать или типа того?
жесть же по стектрейсу выбирать
frontik/server.py
Outdated
http_server.start() | ||
|
||
fill_router(frontik_app.app_module) | ||
_fastapi_app.frontik_app = frontik_app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_fastapi_app в глобальном скоупе как будто проблем только создаст, нельзя его лоальным сделать?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
можно 👍🏻
из какого-то чернового варианта осталось(
modify_times: dict[str, float] = {} | ||
reload = partial(tornado.autoreload._reload_on_update, modify_times) | ||
|
||
server_task = asyncio.gather(server._serve(), periodic_task(reload, check_time)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в ювикорне, вроде авторелоад параметрами передать можно?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
можно потом еще потыкаться, но мне показалось что он ужасен и не подходит нам
во первых он тогда обязательно должен быть не в синглпроцессе а в супервайз режиме и это ломает способ запуска (всмысле вот эти все функции сервер старт/рег в консуле) и сигнал хендлинг при выключении
хз нормально ли оно вообще с нашими докерами/куберами будет работать, типа у нас станет основной процесс супервайзер
во вторых он трекает только фронтик и надо упороться чтобы заставить его другие пакеты тоже мониторить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а торнадовский прост и идеален
смотрит каждые 0,5с на все что у нас заимпорчено, если есть изменения реимпортит
01b3784
to
0b43ede
Compare
d23a77d
to
d26af5f
Compare
db3467b
to
272926b
Compare
SonarQube Quality Gate |
https://jira.hh.ru/browse/HH-212492